namespace Collaboris.Saf.Actions.Moss.Tests.Generated
{
    using Engine.Report;

    using Entities;

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Publishing;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using Moss.Publishing;

    using Saf.Tests;

    using SharePoint.Moss.Publishing;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class CreateRedirectPageTest
    {
        #region Public Methods

        [TestMethod]
        public void CreateRedirectPage_Test()
        {
            var createredirectpage =
                new TestAssistant<CreateRedirectPage, RedirectPageInfo>(
                    TestEnvironment.PublishingSite, "CreateRedirectPageTestWeb", "BLANKINTERNET#0");

            using (createredirectpage)
            {
                MacroReport doReport = createredirectpage.DoMacro();
                PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(createredirectpage.TestWeb);

                PublishingPage page = PublishingPageHelper.GetPage(createredirectpage.FirstEntity.PageName, publishingWeb);

                SPFieldUrlValue urlValue = new SPFieldUrlValue(page.ListItem["Redirect URL"].ToString());

                Assert.AreEqual(createredirectpage.FirstEntity.RedirectUrl, urlValue.Url);
            }
        }

        #endregion
    }
}